# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=zarp
pkgver=0.1.8
pkgrel=8
groups=('blackarch' 'blackarch-exploitation' 'blackarch-networking')
pkgdesc='A network attack tool centered around the exploitation of local networks.'
url='https://github.com/hatRiot/zarp'
arch=('any')
license=('GPL')
depends=('python2' 'python2-paramiko'  'python2-pyasn1' 'python2-flask'
         'mitmproxy')
optdepends=('aircrack-ng: aiding wireless attacks')
makedepends=('git')
source=("https://github.com/hatRiot/$pkgname/archive/$pkgver.tar.gz")
sha512sums=('cb83b3263b0262c547dd933701fa3cf38bc138a082bab263a10df04fe4e00d0571851a5fbcd1895d48fca95a931169190747ac9b816c98c7d686f0da67f1cdb0')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" CONTRIBUTORS README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm CONTRIBUTORS LICENSE README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

